package com.jielihaofeng.springbootredis.service;

import com.jielihaofeng.springbootredis.util.RedisUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service;

/**
 * @description
 * @author Johnnie Wind
 * @date 2020/11/29 19:11
 */
@Service
public class RedisService {

    @Autowired
    RedisTemplate redisTemplate;

    @Autowired
    RedisUtil redisUtil;

    public void test() {
        redisTemplate.opsForValue().set("k1","v1");
        System.out.println(redisTemplate.opsForValue().get("k1"));
        redisUtil.set("k2","v2");
        Object v2 = redisUtil.get("k2");
        System.out.println(v2);
        boolean wzy1 = redisUtil.set("wzy", "no.1");
        Object wzy = redisUtil.get("wzy");
        System.out.println(wzy);

    }



}
